package example.day07.demo04;

/**
 * @author 多易教育
 **/
public class Person {
    String name;
    int age;
    char sex;
    double height;


    //定义一个方法能够直接为这4个成员变量赋值
//    public void set(String n ,int a,char s , double h){
//        name = n;
//        age = a;
//        sex = s;
//        height = h;
//    }


    //this可以区分成员变量和局部变量
    public void set(String name,int age, char sex ,double height){
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.height = height;
    }

    //定义一个方法展示所有成员变量的值
    public void show(){
        System.out.println(name);
        System.out.println(age);
        System.out.println(sex);
        System.out.println(height);
    }


}
